namespace go BlogServices
namespace php BlogServices


struct Category {
    1:i64 Id
    2:string CatName
    3:string AlisaName
    4:i64 ParentId
    5:string Keywords
    6:string Description
    7:i64 Sort
    8:i64 Level
}

struct Menu {
    1:i64 Id
    2:string NavName
    3:i64 ParentId
    4:i64 Sort
    5:string Url
    6:string Type
    7:i64 CatId
}

struct Article {
    1:i64 Id
    2:string Title
    3:string Keywords
    4:string Description
    5:string Imgurl
    6:string Content
    7:i64 CatId
    8:i64 Sort
    9:i64 CreateAt
    10:i64 UpdateAt
    11:i64 ViewNum
    12:string Url
    13:string Markdown
}

struct Config {
    1:string Email
    2:string QQ
    3:string Tel
    4:string Avatar
    5:string SiteName
    6:string SiteKeywords
    7:string SiteDescription
    8:string SiteAuthor
    9:string SiteSign
    10:string SiteIcp
}

struct Link {
    1:i64 Id
    2:string LinkName
    3:string LinkUrl
}

struct Tag {
    1:i64 Id
    2:string TagName
    3:i64 Recommend
}

//定义一个服务
service CategoryService {
    list<Category> GetCategorys()               //获取所有列表信息
    Category GetCategoryInfoById(1:i64 id)    //返回单个列表信息
}

service MenuService {
    Category GetRelationCategoryByMenuId(1:i64 menuid)
    list<Menu> GetMenus()
    list<Menu> GetNextMenus(1:i64 parentId)
    Menu GetMenuById(1:i64 menuid)
}

service ArticleService {
    i64  GetArticleTotal(1:string where)
    list<Article> GetArticles(1:string where,2:i64 offset,3:i64 limit)
    list<Article> GetArticlesByCatId(1:i64 catid,2:i64 offset,3:i64 limit)
    Article GetArticleById(1:i64 id)
}

service ConfigService{
    Config GetConfig()
}

service LinkService {
    list<Link> GetAllLinks()
}

service TagService {
   list<Tag> GetAllTags()
   list<Tag> GetTagsByArticleId(1:i64 articleid)
}